import java.sql.ResultSet;
import java.sql.SQLException;

public class four {
    public static void main(String[] args) throws SQLException, ClassNotFoundException {
        sqlhelper.register_drive("com.mysql.cj.jdbc.Driver");
        sqlhelper.connect("jdbc:mysql://localhost:3306/testDB?serverTimezone=GMT&useSSL=false", "root", "123456");
        sqlhelper.close_commit();
        // insert into tb_user (name, password) values (?, ?)
        System.out.println(sqlhelper.insert("insert into people (name, age) values('Wccc', 21)"));
        ResultSet resultSet = sqlhelper.query("select *from people where name = 'Wccc'");
        while (resultSet.next()) {
            System.out.println(resultSet.getString("name") + " " + resultSet.getInt("age"));
        }

        sqlhelper.commit();
        sqlhelper.close();
    }
}
